Skip to content

feat: add feedback edges#73

Merged
jokroese merged 2 commits into
mainfrom
delay-edges
Dec 12, 2025
Merged

feat: add feedback edges#73
jokroese merged 2 commits into
mainfrom
delay-edges

Conversation

@jokroese
Copy link
Copy Markdown
Member

@jokroese jokroese commented Dec 11, 2025

No description provided.

@netlify
Copy link
Copy Markdown

netlify Bot commented Dec 11, 2025

Deploy Preview for hydraflow ready!

Name Link
🔨 Latest commit d982081
🔍 Latest deploy log https://app.netlify.com/projects/hydraflow/deploys/693c1e27f8ae6100089a23d3
😎 Deploy Preview https://deploy-preview-73--hydraflow.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@jokroese jokroese linked an issue Dec 11, 2025 that may be closed by this pull request
@jokroese jokroese requested a review from solsarratea December 11, 2025 21:58
Copy link
Copy Markdown
Collaborator

@solsarratea solsarratea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

niiiiiit :3

have 2 comments:

  • don't understand what a cycle is now (for cycle detection algorithm), couldn't build an example, does it even have sense to still check this?
  • for future discussion: not following exactly the role of delayFrame.. would work by creating N buffers? would only save a frame every N-executing cycles?

@jokroese
Copy link
Copy Markdown
Member Author

Good points.

The main concept introduced in the PR is the 'delay edge', an edge that sends the previous frame. With this, we can legally create cycles, allowing us to do all the nice feedback things we would want to do with Hydra.

So now we now have two edges: normal edges (which send the current frame) and delay edges (which send the previous frame).

What is a cycle?

Before we checked cycles in the graph. Now we check cycles in the 'same-frame' dependency graph (i.e. ignoring delay edges). A cycle error is now: a directed cycle containing only normal edges. Example: A -> B, B -> A (normal) is an error; A -> B (normal), B -> A (delay) is allowed feedback.

What is delayFrames?

Currently, delay edges only support sending the previous frame. I put in delayFrames in case we want to extend to sending the frame n before the current one. I haven't thought much about if we would want that or how to best implement it!

What I propose

  • Rename 'cycle detection' as 'same-frame cycle detection'
  • Make delayFrames more explicit in being only the previous frame and removing the architecture for the n previous frame

@jokroese
Copy link
Copy Markdown
Member Author

I think I'll also rename 'delay edge' to 'feedback edge'. I know I was big on the 'delay' concept earlier, but playing around with it, 'feedback' feels more intuitive for a user. You support that?

@solsarratea
Copy link
Copy Markdown
Collaborator

agree with renaming on feedback edge :)
and simplifying the delayFrames

i still can't think of a scenario where this A -> B, B -> A will happen without creating a feedback edge, making me doubt if we even need to check for cycles. but still agree "same-frame cycle detection" is better naming

@jokroese
Copy link
Copy Markdown
Member Author

A -> B, B -> A without a feedback edge is bad. We check for that and error if it happens. We need to check that to validate that we are building good graphs.

However, I've made it neater for users so that creating A -> B, B -> A automatically creates a feedback edge, as that is what I presume they want to happen.

So, whilst a user would struggle to create an invalid cycle in the UI, it's important that we check for it so we're sure we're building valid graphs.

@jokroese jokroese changed the title feat: add delay edges feat: add feedback edges Dec 12, 2025
@jokroese jokroese merged commit 47adb54 into main Dec 12, 2025
5 checks passed
@jokroese jokroese deleted the delay-edges branch December 12, 2025 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add 'delay edge' for showing previous frame

2 participants